﻿// See https://aka.ms/new-console-template for more information


using cuyan.resume.analysis;
using cuyan.resume.analysis.Utlis;
using Newtonsoft.Json;
using System.Data.SQLite;
using test;

string rootPath = Directory.GetCurrentDirectory();
string dbPath = rootPath + @"\ra.db";
SQLiteUtlis.CreateDB(dbPath);
SQLiteUtlis.SetConnectionString(dbPath, "");
//ResumeAnalysisPackage.RefreshCompilation();
var analysisTool = new AnalysisTool();
var baidu_apikey = Baidu_Accurate.GetToken("百度appid", "百度app密钥");
var result = Baidu_Accurate.SBZP(@"C:\Users\dao\Desktop\简历.jpg", baidu_apikey);
var jArray = JsonConvert.DeserializeObject<ORCResult>(result);
List<string> resultList = new List<string>();
if (jArray != null && jArray.words_result.Count() > 0)
{
    resultList = jArray.words_result.Select(x => x.words).ToList();
}
var raResult = analysisTool.ResumeAnalysisStart(resultList);

Console.WriteLine("简历解析结果：\n"+JsonConvert.SerializeObject(raResult));